//
// Created by root on 6/29/17.
//

#ifndef FUNNY_SCHEME_CONSTANTS_H
#define FUNNY_SCHEME_CONSTANTS_H

#include "cell.h"

#ifdef TRUE
#undef TRUE
#endif
#define TRUE 1

#ifdef FALSE
#undef FALSE
#endif
#define FALSE 0

/*
Basic types hierarchy:

-Object
  -Class
  -Atom
    -Boolean
    -Enum
    -Number
      -Complex
        -Real
          -Decimal
          -Fraction
          -Integer
    -Character
    -String
  -Symbol
    -Syntax
  	-Property
  -Vector
  -Environment
  -Procedure
    -Closure
    -Continuation
    -Method
    -Constructor
  -Exception
  -Pair
    -Promise
 * */

#define UNKNOWN_NAME       "[UNKNOWN]"
#define UNKNOWN_TYPE       "[UNKNOWN]"
#define POINTER            "[POINTER]"

#define OBJECT_TYPE        "Object"
#define SYSTEM_OBJECT      "SystemObject"
#define CLASS_TYPE         "Class"
#define ATOM_TYPE          "Atom"
#define PAIR_TYPE          "Pair"
#define BOOLEAN_TYPE       "Boolean" //primitive
#define INTEGER_TYPE       "Integer" //primitive
#define REAL_TYPE          "Real"
#define FRACTION_TYPE      "Fraction"
#define DECIMAL_TYPE       "Decimal"
#define COMPLEX_TYPE       "Complex"
#define DOUBLE_TYPE        "Double" //primitive
#define NUMBER_TYPE        "Number"
#define CHARACTER_TYPE     "Character" //primitive
#define STRING_TYPE        "String" //primitive
#define SYMBOL_TYPE        "Symbol"
#define SYNTAX_TYPE        "Syntax"
#define PROPERTY_TYPE      "Property"
#define VECTOR_TYPE        "Vector"
#define FUNCTION_TYPE      "Function"
#define PROCEDURE_TYPE     "Procedure"
#define EXCEPTION_TYPE     "Exception"
#define METHOD_TYPE        "Method"
#define CONSTRUCTOR_TYPE   "Constructor"

#define CLOSURE_TYPE       "Closure"
#define PROMISE_TYPE       "Promise"
#define CONTINUATION_TYPE  "Continuation"
#define ENVIRONMENT_TYPE   "Environment"

#define RESOURCE_TYPE      "Resource"
#define MODULE_TYPE        "Module"
#define PACKAGE_TYPE       "Package"

#define DEFAULT_FRAME_SIZE   13

// 词法标记
#define TOK_EOF     -1				// 输入结束
#define TOK_LPAREN  0				// (
#define TOK_RPAREN  1				// )
#define TOK_DOT     2				// .
#define TOK_ATOM    3				// 原子 （number id symbol ）
#define TOK_QUOTE   4				// '
#define TOK_COMMENT 5				// ;
#define TOK_DQUOTE  6				// "
#define TOK_SHARP   7				// #
#define TOK_SHARP_CONST 8			// #  常量 (例如 #t #f #\a)
#define TOK_VECTOR  9				// #( 数组

#define DELIMITERS  "()\";\f\t\v\n\r "	// 分隔符



Cell* G_NIL;
Cell* G_EOF;
Cell* G_TRUE;
Cell* G_FALSE;

Cell* N_ZERO;
Cell* N_ONE;

void init_constants();

SCHEME_GC scheme_gc;


#endif //FUNNY_SCHEME_CONSTANTS_H
